<?php
require(dirname(__FILE__)."/"."../../inc/common.inc.php");
admin(18);
?>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../js/html5.js"></script>
    <script type="text/javascript" src="../js/respond.min.js"></script>
    <script type="text/javascript" src="../js/PIE_IE678.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="../css/H-ui.css"/>
    <link type="text/css" rel="stylesheet" href="../css/H-ui.admin.css"/>
    <link type="text/css" rel="stylesheet" href="../font/font-awesome.min.css"/>
    <!--[if IE 7]>
    <link href="../font/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <title>开奖列表</title>
</head>
<body>
<?php
if($del){
	if (empty($id)){
		refreshto($FROMURL,'删除失败!',2);
	}
    $query = $db->query("DELETE FROM chen_activity WHERE id='{$id}'");
    refreshto($FROMURL,'删除成功!',2);

}
?>
<nav class="Hui-breadcrumb"> <?=get_category(14)?> <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.href='?';" title="刷新" ><i class="icon-refresh"></i></a></nav>
<div class="pd-20">
    <div class="">
        <form class="Huiform" method="get" action="?" >
            <input type="hidden" name="page" value="1">
            <input type="text" placeholder="输入关键词查询" autocomplete="off" value="<?=$keyword?$keyword:''?>" name="keyword"  class="input-text">

            <button type="submit" class="btn btn-success" id="12" name="12" value="12" >
                <i class="icon-search"></i>搜索
            </button>
            <button type="button" class="btn btn-success" onClick="add('0','1000','600','活动管理','activity_add.php')" >
                <i class="icon-plus"></i>添加
            </button>
        </form>
    </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr>
            <td >ID</td>
            <td >活动时间</td>
            <td >活动地点</td>
            <td >活动路线</td>
            <td >活动大致内容及意义</td>
            <td >所在地址</td>
            <td >总人数</td>
            <td width="80">操作</td>
        </tr>
        </thead>
        <tbody>
        <?php
         $rows=20;
         if($page<1){
             $page=1;
         }
         $min=($page-1)*$rows;
         if($adminarr['u_gid']==0){
             $isql.="";
         }
         if($keyword!=''  ){
             $isql.=" and ( activity_route like '%{$keyword}%'  or content like '%{$keyword}%' or activity_location like '%{$keyword}%')";
         }
         $rsd=$db->query("select * from {$pre}activity where 1=1 {$isql} order by id desc LIMIT $min,$rows");
         while($rs=$db->fetch_array($rsd)){?>
         <tr>
           <td><?= $rs['id']?></td>
           <td><?= $rs['activity_time']?></td>
           <td><?= $rs['activity_location']?></td>
           <td><?= $rs['activity_route']?></td>
           <td><?= $rs['content']?></td>
           <td><?= $rs['location']?></td>
           <td ><?= $rs['people']?></td>
           <td>
               <a title="查看" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="icon-share"></i></a>
               <a title="编辑" href="javascript:;" onClick="add('<?=$rs['id']?>','1000','600','活动管理','activity_add.php?action=reg&uid=<?=$rs['id']?>')" class="ml-5" style="text-decoration:none"><i class="icon-edit"></i></a>
               <a title="删除" href="?del=del&id=<?=$rs['id']?>" onClick="if(confirm('是否真的要删除本信息')){location.href=''+this.href};return false;" class="ml-5" style="text-decoration:none"><i class="icon-trash"></i></a></td>
        <?php }?>
        <tr class="text-c">
            <td colspan="100"><?=getpage(" {$pre}activity  ","where 1=1 ","?keyword=$keyword",$rows)?></td>
        </tr>
        </tbody>
    </table>

</div>

<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="../layer/layer.min.js"></script>
<script type="text/javascript" src="../js/H-ui.js"></script>
<script type="text/javascript" src="../js/H-ui.admin.js"></script>
<script type="text/javascript">
    $(".Huiform").Validform();
    function add(id,w,h,title,url){
        layer_show(w,h,title,url);
    }
</script>
</body>
</html>